'''This Is the command class. The parser will transform a message into a command'''
'''This class is meant to be sub-classed into the different kinds of commands'''


class Command:


    def __init__(self, owner, admins, server, message):
        self.owner = owner
        self.admins = admins
        self.message = message
        self.server = server


    def runCommand(self):
        pass

    def __checkPermission(self):
        '''
        This method is to check the permission level of the person sending the message
        It will return a string with the permission level available to that user.
        '''
        if (self.message.nick == self.owner):
            return 'owner'
        elif (self.message.nick in self.admins):
            return 'admin'
        else:
            return 'none'

'''
What kinds of commands are there going to be?
Raw

'''
class RawCommand (Command):
    '''This is the raw command class'''

    def runCommand(self):
        mStr = ''
        if self.__checkPermission() == 'owner':
            '''So we have permission?'''
            mStr = ' '.join(self.message.message[1:])

        self.server.sendMessage()

    pass

class MeCommand (Command):
    '''These are commands sent to me'''
    def runCommand(self):
        if self.checkPermission() == 'owner':
            pass

